/*
Date:20210530 19:18:00PM
key:滑动窗口，每一个i作一次起点，用集合去存i-n，存满全字符种类就记录本次的i
*/
#include <iostream>
#include <vector>
#include<unordered_set>
#include<set>
using namespace std;

int main()
{
	string s;
	cin >> s;
	set<char>se;
	const int n= s.size();
	for (int i = 0; i < n; i++)
	{
		se.insert(s[i]);
	}
	//得知总共有几个不同的字符
	//cout << se.size();
	const int dis = se.size();
	int start1, length1=0xffff7;
	int start, length;
	for (int i = 0; i < n; i++)
	{
		set<char>se1;
		for (int j = i; j < n; j++)
		{
			se1.insert(s[j]);
			if (se1.size() == dis)
			{
				start = i;
				length = j-i+1;
				if(length<length1){
					start1 = start;
					length1 = length;
				}
			}
		}
	}
	cout << start1 << "," << length1;
}